<?php

namespace app\controller;

use app\service\IndexService;
use support\Request;

class IndexController
{
    /**
     * @var IndexService
     */
    private $indexService;

    public function __construct()
    {
        $this->indexService = new IndexService();
    }

    public function index(Request $request)
    {

        $this->indexService->index();
        return response('hello webman');
    }

    public function view(Request $request)
    {
        return view('index/view', ['name' => 'webman']);
    }

    public function json(Request $request)
    {
        return json(['code' => 0, 'msg' => 'ok']);
    }

}
